<?php
if ( !defined( "IN_OP" ) )
{
    exit( "You can't access this file directly..." );
}
$ui = new UI();
$tpl = new template2();
$tpl->load( "main", "modify.htm" );
$acl_name = array( "", "会员", "代理商", "总代理", "股东", "大股东" );
if ( $curruser['prev_id'] == 0 )
{
    include( "admin_menu.php" );
}
else
{
    include( "admin_menu1.php" );
}
$list = "";
$page = intval( getvar( "p" ) );
if ( $page == 0 )
{
    $page = 1;
}
$rs = getdb( "select * from modifybook where percent_mode=0 order by id desc", $page, 20 );
while ( !$rs->eof )
{
    $list .= "<tr class=td2>";
    $list .= "<td nowrap>".date( "Y-m-d H:i:s", $rs->f['dt'] );
    if ( 5 < $rs->f['acl1'] )
    {
        $list .= "<td nowrap align=center>公司";
    }
    else
    {
        $list .= "<td nowrap align=center>".$acl_name[$rs->f['acl1']];
    }
    $list .= "<td nowrap>".$rs->f['account1'];
    $list .= "<td nowrap>".$rs->f['name1'];
    if ( 5 < $rs->f['acl2'] )
    {
        $list .= "<td nowrap align=center>公司";
    }
    else
    {
        $list .= "<td nowrap align=center>".$acl_name[$rs->f['acl2']];
    }
    $list .= "<td nowrap>".$rs->f['account2'];
    $list .= "<td nowrap>".$rs->f['name2'];
    $list .= "<td nowrap align=right>".$rs->f['percent0_old'];
    $list .= "<td nowrap align=right>".$rs->f['percent0_new'];
    $list .= "<td nowrap align=right>".$rs->f['percent1_old'];
    $list .= "<td nowrap align=right>".$rs->f['percent1_new'];
    $list .= "<td nowrap align=right>".$rs->f['mpercent_old'];
    $list .= "<td nowrap align=right>".$rs->f['mpercent_new'];
    $list .= "<td nowrap align=right>".$rs->f['amount_old'];
    $list .= "<td nowrap align=right>".$rs->f['amount_new'];
    $list .= "<td nowrap>".$rs->f['modify'];
    $list .= "</tr>";
    $rs->movenext();
}
$rs->close();
$url = "op.php?op=admin&fp=modify&p=";
if ( $page == 1 )
{
    $button = "第一页 &nbsp; 上一页 &nbsp; <a href=\"".$url."2\">下一页</a> &nbsp; <a href=\"".$url.$rs->totalpages."\">最後页</a>";
}
else if ( $page == $rs->totalpages )
{
    $button = "<a href=\"".$url."1\">第一页</a> &nbsp; <a href=\"".$url.( $page - 1 )."\">上一页</a> &nbsp; 下一页 &nbsp; 最後页";
}
else
{
    $button = "<a href=\"".$url."1\">第一页</a> &nbsp; <a href=\"".$url.( $page - 1 )."\">上一页</a> &nbsp; <a href=\"".$url."2\">下一页</a> &nbsp; <a href=\"".$url.$rs->totalpages."\">最後页</a>";
}
$tpl->set( "button", $button );
$tpl->set( "list", $list );
$tpl->show( "main" );
?>